<?php
// 应用公共文件


if (!function_exists('completeUrl')) {
    function completeUrl($url)
    {
        if (empty($url)) {
            return $url;
        }

        if (strpos($url, 'http') !== false) {
            return $url;
        }
        if (!empty($str) && substr($str, 0, 1) === '/') {

        } else {
            $url = '/'.$url;
        }

        $pageURL = 'http';
        if (isset($_SERVER['HTTPS']) && $_SERVER["HTTPS"] == "on") {
            $pageURL .= "s";
        }
        $pageURL .= "://";

        $pageURL .= $_SERVER["SERVER_NAME"];

        return $pageURL . $url;
    }
}